<template>
	<view>
		<!-- <u-sticky>
			<view>
				<u-tabs :list="list" :is-scroll="false" :current="current" @change="change">
				</u-tabs>
			</view>

		</u-sticky> -->
		<view>
			<uni-card :title="item.title" :extra="item.startTime" v-for="(item,index) in courseList" :key="index">
				<text class="uni-body" v-html="item.content" style="line-height: 60px;"></text>
				<uni-list>
					<uni-list-item :title="item.teacherName"></uni-list-item>
					<uni-list-item :title="item.className"></uni-list-item>
				</uni-list>
			</uni-card>

		</view>

		<!-- <view v-else>
		<uni-card :title="item.title" :extra="item.addrs" v-for="(item,index) in courseList2" :key="index">
			<text class="uni-body" v-html="item.content" style="line-height: 60px;"></text>
			<uni-list>
				<uni-list-item :title="item.attendClassTime"></uni-list-item>
				<uni-list-item :title="item.quittingTime"></uni-list-item>
			</uni-list>
		</uni-card>
		</view> -->
	</view>
</template>

<script>
	import {
		getActiveByStudentId
	} from '@/api/jz/student/info.js';
	import {

		getInfoId,

	} from '@/utils/auth';
	export default {
		data() {
			return {
				list: [{
					name: '待上课',
					count: 0

				}, {
					name: '已上课'
				}],
				current: 0,
				courseList: [],
				courseList2: []
			}
		},
		mounted() {
			this.getActiveByStudentId();
		},
		methods: {
			change(index) {
				this.current = index;
			},
			async getActiveByStudentId() {

				await getActiveByStudentId(getInfoId()).then((res) => {
					for (var i = 0; i < res.length; i++) {
						res[i].teacherName = "老师：" + res[i].teacherName;
						res[i].className = "班级名称：" + res[i].className;
					}
					this.courseList = res


				})
			},
		}
	}
</script>
<style scoped lang="scss">

</style>